package com.cosmoplat.xikai.business.domain;

import com.cosmoplat.xikai.common.core.domain.BaseEntity;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;

/**
 * @TableName base_material
 */
@Data
@ApiModel(value = "物料信息", description = "用于表示系统中的物料信息")
public class BaseMaterial extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @ApiModelProperty(value = "主键", required = false, example = "1")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /**
     * 物料ID
     */
    @ApiModelProperty(value = "物料ID", required = true, example = "MAT001")
    @NotBlank(message = "物料ID不能为空")
    private String materialId;

    /**
     * 物料编号
     */
    @ApiModelProperty(value = "物料编号", required = true, example = "CODE001")
    @NotBlank(message = "物料编号不能为空")
    private String materialCode;

    /**
     * 物料名称
     */
    @ApiModelProperty(value = "物料名称", required = true, example = "示例物料")
    @NotBlank(message = "物料名称不能为空")
    private String materialName;

    /**
     * 计量单位
     */
    @ApiModelProperty(value = "计量单位", example = "个")
    private String unitOfMeasure;

    /**
     * 物料分类
     */
    @ApiModelProperty(value = "物料分类", example = "原材料")
    private String materialCategory;

    /**
     * 物料规格
     */
    @ApiModelProperty(value = "物料规格", example = "100x200mm")
    private String materialSpec;

    /**
     * 物料型号
     */
    @ApiModelProperty(value = "物料型号", example = "MODEL-A")
    private String materialModel;

    /**
     * 物料描述
     */
    @ApiModelProperty(value = "物料描述", example = "这是对物料的描述")
    private String materialDescription;

    /**
     * 最后修改时间
     */
    @ApiModelProperty(value = "最后修改时间", hidden = false)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date lastModifyTime;

    /**
     * 逻辑删除标志，默认未删除
     */
    @ApiModelProperty(value = "逻辑删除标志，默认未删除", example = "false")
    private Boolean isDelete;
}